-- GENERATED SPELL FOR [Auchenai Vindicator] --


function spell0_18495(pUnit, Event) --@Shadow Shock,n/a--
pUnit:FullCastSpellOnTarget(17289,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18495', 623, 1)
end

function spell1_18495(pUnit, Event) --@Shadow Shock,n/a--
pUnit:FullCastSpellOnTarget(17439,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18495', 663, 1)
end

function spell2_18495(pUnit, Event) --@Shadowguard,n/a--
pUnit:FullCastSpellOnTarget(32861,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18495', 0, 1)
end

function spell3_18495(pUnit, Event) --@Shadowguard,n/a--
pUnit:FullCastSpellOnTarget(38379,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18495', 0, 1)
end

function spell4_18495(pUnit, Event) --@Summon Phantasmal Possessor,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(32857,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18495', 1, 1)
end

function spell5_18495(pUnit, Event) --@Summon Unliving Cleric,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(32855,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18495', 1, 1)
end

function spell6_18495(pUnit, Event) --@Summon Unliving Soldier,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(32853,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18495', 1, 1)
end

function spell7_18495(pUnit, Event) --@Summon Unliving Sorcerer,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(32854,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18495', 1, 1)
end

function spell8_18495(pUnit, Event) --@Summon Unliving Stalker,Self--
pUnit:FullCastSpellOnTarget(32856,pUnit)
pUnit:RegisterEvent('Sorts_18495', 571, 1)
end

function Sorts_18495(pUnit, Event)
local choix_sorts_18495 = math.random(0, 8)
if choix_sorts_18495 == 0 then
pUnit:RegisterEvent('spell0_18495', 1, 1)
end
if choix_sorts_18495 == 1 then
pUnit:RegisterEvent('spell1_18495', 1, 1)
end
if choix_sorts_18495 == 2 then
pUnit:RegisterEvent('spell2_18495', 1, 1)
end
if choix_sorts_18495 == 3 then
pUnit:RegisterEvent('spell3_18495', 1, 1)
end
if choix_sorts_18495 == 4 then
pUnit:RegisterEvent('spell4_18495', 1, 1)
end
if choix_sorts_18495 == 5 then
pUnit:RegisterEvent('spell5_18495', 1, 1)
end
if choix_sorts_18495 == 6 then
pUnit:RegisterEvent('spell6_18495', 1, 1)
end
if choix_sorts_18495 == 7 then
pUnit:RegisterEvent('spell7_18495', 1, 1)
end
if choix_sorts_18495 == 8 then
pUnit:RegisterEvent('spell8_18495', 1, 1)
end
end

function mob18495_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18495', math.random(1500, 3000), 1)
end

function mob18495_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18495_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18495_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18495, 1, 'mob18495_Action')
RegisterUnitEvent(18495, 2, 'mob18495_Leave')
RegisterUnitEvent(18495, 3, 'mob18495_Kill')
RegisterUnitEvent(18495, 4, 'mob18495_Die')
